package com.sx.entity.basic;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sx.basic.BasicEntity;
import com.sx.basic.serializer.LongToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * @author AdinZ
 * @date 2020/11/12 13:49
 */
@Data
@NoArgsConstructor
@TableName(value = "sx_article_category")
@Entity
@Table(name = "sx_article_category")
@ApiModel(description = "文章分类表")
public class CategoryEntity extends BasicEntity {
    @Id
    @GeneratedValue
    @TableId(type = IdType.ASSIGN_ID)
    @JSONField(serializeUsing = LongToStringSerializer.class)
    private Long id;
    @ApiModelProperty("上级分类id")
    @JSONField(serializeUsing = LongToStringSerializer.class)
    private long cid;
    @ApiModelProperty("连级id")
    private String scid;
    @ApiModelProperty("分类名称")
    private String typename;
    @ApiModelProperty("分类简介")
    private String body;
    @ApiModelProperty("分类图标")
    private String thump;
    @ApiModelProperty("排序")
    private int sort;
    @ApiModelProperty("创建时间")
    private long created=System.currentTimeMillis();
    @ApiModelProperty("是否隐藏")
    private boolean hidden;

}
